import numpy as np

from tensorflow.keras.preprocessing.image import img_to_array

class Img_2_Array_Preprocess:
    def __init__(self, data_format=None):
        self.data_format = data_format

    def processor(self, image) -> np.ndarray:
        return img_to_array(image, data_format=self.data_format)


if __name__ == '__main__':
    from train_pac.normal.SimpleProcessor import Simple_Processor
    from train_pac.normal.SimpleDataSetLoader import Simple_DataSet_Loader
    sp = Simple_Processor(32, 32)
    iap = Img_2_Array_Preprocess()
    sdl = Simple_DataSet_Loader(preprocessors=[sp, iap])
    data, label = sdl.load(['D:/bee/dataset/dog_cat/cat.0.jpg'])
    print(data, data.shape, label, label.shape)